﻿using System.ComponentModel;

namespace tumblr.ViewModels
{
    public abstract class ViewModelBase : INotifyPropertyChanged
    {
        public bool IsDataLoaded
        {
            get;
            protected set;
        }

        public virtual void LoadData()
        {
            IsDataLoaded = true;
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected void RaisePropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
